package com.jlpay.open.jlpay.sdk.java.exception;

/**
 * HTTP 状态码异常
 *
 * @author zhaomeixia
 * @since 2024/2/20
 */
public class HttpStatusCodeException extends JlpayException {

    private final int httpStatusCode;

    private final String responseBody;

    public HttpStatusCodeException(int httpStatusCode, String responseBody, String xRequestId) {
        super(String.format("Unexpected http status code %d, response: %s, xRequestId: %s", httpStatusCode,
                responseBody, xRequestId));
        this.httpStatusCode = httpStatusCode;
        this.responseBody = responseBody;
    }
}
